/**
 *  src[string] pdf的url
 *  show[bool] 打开pdf
 *  onCancel[fn] 关闭查看器的回调
 *  */

import React from 'react';
import { Modal } from 'antd';

export default (props) => {
  const {
    src,
    show = true,
    title = '',
    onCancel = () => {}
  } = props;
  if (!src) {
    return null;
  }
  return (
    <Modal
      footer={false}
      title={title}
      visible={show}
      onCancel={onCancel}
      width={800}
    >
      <img src={src} style={{width: '100%', height: '100%'}} />
    </Modal>
  );
}
